-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for sqlite3_unlock_notify #439
Conversation
kick travis |
Could you please rebase ? |
708b649
to
39f6e5d
Compare
I'd like to add a test for what the PR tries to fix but cannot deliver it in the first few attempts. I'll try later when I have more free time. |
@typeless Could you rebase |
39f6e5d
to
e5c24c6
Compare
@gjrtimmer Done |
I wonder this can be tested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think only one tiny code comment
I notice that in the step function, you check the extended error code to make sure it's |
e5c24c6
to
29fac6b
Compare
@bvinc It was modified from the example code: https://sqlite.org/unlock_notify.html The explanation of the |
By the way, I have found a test which can reproduce the "database is locked" error but it turned out that the PR does not fix the problem. I'll try to figure it out later and see if this PR has any hope to be helpful. |
Which test can still reproduce "database is locked" error with this PR? |
I found your test case in a closed PR. I assume this is the test case that you're talking about. I believe that there is some confusion again between Without using shared cache mode (which applies to your test), when two transactions conflict, the one that fails uses the busy handler, which waits a small number of random milliseconds, and then tries again. Once this fails for 5 seconds (which is the default busy timeout for this driver), then it fails with But this PR is about something completely different. This PR is about stopping people from getting |
@bvinc You're correct I misunderstood the two different errors. I need to try it again when I come back to this. |
29fac6b
to
60b4183
Compare
@mattn @gjrtimmer @bvinc The test has been added. PTAL. |
60b4183
to
67813ad
Compare
Hmmm, I have to make it compatible with |
ad29852
to
6903ee1
Compare
A new build tag |
d842230
to
bd18b90
Compare
Found a bug while trying to integrate the change into Gitea. I am looking into it. |
bd18b90
to
0fce88d
Compare
3da01bd
to
5cc988d
Compare
5cc988d
to
eb08795
Compare
The bugs have been figured out. For now, all available tests pass. |
Thank you. Sounds good to me. One thing. please add |
@mattn Done. Is that what you mean? |
Yes! Thank you. |
https://sqlite.org/unlock_notify.html mattn/go-sqlite3#439 Rather than erroring when a table is locked, this should hopefully make the action just wait
* Log error details when persisting a location * Flag in sqlite3_unlock_notify https://sqlite.org/unlock_notify.html mattn/go-sqlite3#439 Rather than erroring when a table is locked, this should hopefully make the action just wait
For go-gitea/gitea#2040
Added new build tag
sqlite_unlock_notify
.